home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c++
- Subject: Re: converting strings to ints??
- Date: Sun, 11 Feb 1996 14:09:35 GMT
- Organization: Netcom
- Message-ID: <311df758.156507255@nntp.ix.netcom.com>
- References: <4fk223$s6k@newsbf02.news.aol.com> <marnoldDMLyuM.9Io@netcom.com>
- NNTP-Posting-Host: ix-dc12-11.ix.netcom.com
- X-NETCOM-Date: Sun Feb 11 6:09:05 AM PST 1996
- X-Newsreader: Forte Agent .99d/32.182
-
- marnold@netcom.com (Matt Arnold) wrote:
-
- > possum4456@aol.com (Possum4456) writes:
- >
- > >Is there a function, I heard it was in stdio.h, that converts a string of
- > >numbers to integers so they can be added or whatever?:-)
- >
- > atoi() // name comes from "ANSI to integer"
- >
- >
- > Don't you have any documentation with your compiler or at least a good
- > "C" book? This is basic stuff. This wasn't even a C++ question. Try
- > comp.lang.c next time.
-
- Why is this not a C++ question? atoi() is part of the C++ language.
- The fact that it is also part of another language doesn't make it
- unsuitable for discussion here.
-
- Of course, atoi() should be documented, but many compilers document
- such things in ways that are difficult for a beginner to find. I've
- seen several that simply list functions in alphabetic order --
- certainly not the best for finding a function knowing the task it is
- to do.
-
- It's also probably worth noting that strtol() is often a better choice
- than atoi() since it gives help in error checking.
-
-
- Michael M Rubenstein
-